<template>
    <div>
        <el-form :inline="false" :model="formInline" class="demo-form-inline">
            <el-form-item label="时间">
                <el-input v-model="formInline.date" placeholder="时间" clearable />
            </el-form-item>
            <el-form-item label="地址">
                <el-select v-model="formInline.address" placeholder="地址" clearable>
                    <el-option label="shanghai" value="shanghai" />
                    <el-option label="beijing" value="beijing" />
                </el-select>
            </el-form-item>
            <el-form-item label="名字">
                <el-input v-model="formInline.name" placeholder="名字" clearable />
            </el-form-item>
        </el-form>
        <div class="float-right">
            <el-button type="primary" @click="handelCLickOk">确 定</el-button>
            <el-button @click="emit('cancel')">取 消</el-button>
        </div>
    </div>
</template>

<script setup >
import { onMounted, ref } from 'vue'
const emit = defineEmits(['cancel', 'success'])
const props = defineProps({
    initialRow: Object
})
const formInline = ref({
    date: '',
    address: '',
    name: '',
})

onMounted(() => {

    console.log('rows', props.initialRow)
    formInline.value = props.initialRow

})
function handelCLickOk() {
    emit('success', formInline.value)
}
</script>

<style lang="less" scoped></style>